//
//  FeatureCollectionViewCell.m
//  DayByDay
//
//  Created by dllo on 16/5/18.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "FeatureCollectionViewCell.h"
#import <UIImageView+WebCache.h>

@interface FeatureCollectionViewCell ()

@property (nonatomic, strong)UIImageView *bgImageV;
@property (nonatomic, strong)UIImageView *smallImageV;
@property (nonatomic, strong)UILabel *titleLabel;
//@property (nonatomic, strong)UILabel *sub_titleLabel;
@property (nonatomic, strong)UILabel *nameLabel1;
@property (nonatomic, strong)UILabel *nameLabel2;
@property (nonatomic, strong)UILabel *nameLabel3;

@end

@implementation FeatureCollectionViewCell

- (void)setModel:(RefsModel *)model {
    _model = model;
    [self.bgImageV sd_setImageWithURL:[NSURL URLWithString:_model.pic_url]];
    if ([_model.ranklist_id integerValue] == -1) {
        self.smallImageV.image = nil;
    } else {
        self.smallImageV.image = [UIImage imageNamed:@"entering_record_btn_play"];
    }
    self.titleLabel.text = [NSString stringWithFormat:@"%@  %@",_model.title, _model.sub_title];
    RefsSongsModel *songsModel1 = _model.songs[0];
    self.nameLabel1.text = [NSString stringWithFormat:@"1  %@-%@", songsModel1.name, songsModel1.singerName];
    RefsSongsModel *songsModel2 = _model.songs[1];
    self.nameLabel2.text = [NSString stringWithFormat:@"2  %@-%@", songsModel2.name,songsModel2.name];
    RefsSongsModel *songsModel3 = _model.songs[2];
    self.nameLabel3.text = [NSString stringWithFormat:@"3  %@-%@", songsModel3.name,songsModel3.singerName];
    
    
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    self.bgImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, WIDTH / 3, WIDTH / 3)];
    self.smallImageV = [[UIImageView alloc] initWithFrame:CGRectMake(WIDTH / 3 - 50, WIDTH / 3 - 50, 40, 40)];
    [self.contentView addSubview:self.bgImageV];
    [self.bgImageV addSubview:self.smallImageV];
    //    self.smallImageV.image = [UIImage imageNamed:@"entering_record_btn_play"];
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 3 + 10, 0, WIDTH / 3 * 2 - 10 , 30)];
    self.nameLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 3 + 10, 40, WIDTH / 3 * 2 - 10, 20)];
    self.nameLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 3 + 10, 70, WIDTH / 3 * 2 - 10, 20)];
    self.nameLabel3 = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 3 + 10, 100, WIDTH / 3 * 2 - 10, 20)];
    [self.contentView addSubview:self.titleLabel];
    [self.contentView addSubview:self.nameLabel1];
    [self.contentView addSubview:self.nameLabel2];
    [self.contentView addSubview:self.nameLabel3];
    self.nameLabel1.font = [UIFont systemFontOfSize:15];
    self.nameLabel2.font = [UIFont systemFontOfSize:15];
    self.nameLabel3.font = [UIFont systemFontOfSize:15];
    
}


@end
